package io.renren.modules.blog.dto;

import io.renren.common.utils.TreeNode;
import io.renren.common.validator.group.AddGroup;
import io.renren.common.validator.group.DefaultGroup;
import io.renren.common.validator.group.UpdateGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.io.Serializable;

@ApiModel(value = "博客路由管理")
public class BlogRouterDto extends TreeNode<BlogRouterDto> implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "id")
    @Null(message = "{id.null}", groups = AddGroup.class)
    @NotNull(message = "{id.require}", groups = UpdateGroup.class)
    private Long id;

    @ApiModelProperty(value = "上级ID")
    @NotNull(message = "{blogrouter.pid.require}", groups = DefaultGroup.class)
    private Long pid;

    @NotNull(message = "{blogrouter.path.require}", groups = DefaultGroup.class)
    private String path;

    @NotNull(message = "{blogrouter.name.require}", groups = DefaultGroup.class)
    private String name;

    @NotNull(message = "{blogrouter.hidden.require}", groups = DefaultGroup.class)
    private Integer hidden;

    @NotNull(message = "{blogrouter.noNeedLogin.require}", groups = DefaultGroup.class)
    private Integer noNeedLogin;

    @NotNull(message = "{blogrouter.component.require}", groups = DefaultGroup.class)
    private String component;

    private String permissions;

    @ApiModelProperty(value = "类型  0：菜单   1：按钮")
    @Range(min=0, max=1, message = "{blogrouter.type.menuType}", groups = DefaultGroup.class)
    private Integer menuType;

    private String icon;

    @NotNull(message = "{blogrouter.sort.require}", groups = DefaultGroup.class)
    private Integer sort;

    @Override
    public Long getId() {
        return id;
    }

    @Override
    public void setId(Long id) {
        this.id = id;
    }

    @Override
    public Long getPid() {
        return pid;
    }

    @Override
    public void setPid(Long pid) {
        this.pid = pid;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getHidden() {
        return hidden;
    }

    public void setHidden(Integer hidden) {
        this.hidden = hidden;
    }

    public Integer getNoNeedLogin() {
        return noNeedLogin;
    }

    public void setNoNeedLogin(Integer noNeedLogin) {
        this.noNeedLogin = noNeedLogin;
    }

    public String getComponent() {
        return component;
    }

    public void setComponent(String component) {
        this.component = component;
    }

    public String getPermissions() {
        return permissions;
    }

    public void setPermissions(String permissions) {
        this.permissions = permissions;
    }

    public Integer getMenuType() {
        return menuType;
    }

    public void setMenuType(Integer menuType) {
        this.menuType = menuType;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }
}
